home *** CD-ROM | disk | FTP | other *** search
/ Supersonic - A Multimedi… Modern Military Aircraft / Supersonic - A Multimedia Guide to Modern Military Aircraft (InterActive Publishing Corporation)(1993).ISO / mac / SUPERS / SAMPSPR.MST < prev    next >
Text File  |  1993-10-20  |  7KB  |  226 lines

  1. '**************************************************************************
  2. '*                       Setup Supersonic
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST WELCOME       = 100
  12. CONST ASKQUIT       = 200
  13. CONST DESTPATH      = 300
  14. CONST EXITFAILURE   = 400
  15. CONST EXITQUIT      = 600
  16. CONST EXITSUCCESS   = 700
  17. CONST APPHELP       = 900
  18. CONST BADPATH       = 6400
  19. CONST AUTFILE       = 1100
  20.  
  21. ''Bitmap ID
  22. CONST LOGO = 1
  23.  
  24. GLOBAL DEST$        ''Default Windows directory.
  25.  
  26. DECLARE SUB Install
  27. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  28. DECLARE FUNCTION AutoRedactor LIB "AUTF.DLL" (SrcDir$) AS INTEGER 
  29.  
  30. INIT:
  31.     CUIDLL$ = "mscuispr.dll"            ''Interface dll
  32.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  33.  
  34.     SetBitmap CUIDLL$, LOGO
  35.     SetTitle "Setup Supersonic"
  36.  
  37.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  38.     IF szInf$ = "" THEN
  39.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SAMPSPR.INF"
  40.     END IF
  41.     ReadInfFile szInf$
  42.  
  43.     DEST$ = GetWindowsDir()
  44.  
  45. '$IFDEF DEBUG
  46.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  47.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  48.     IF IsDriveValid(WinDrive$) = 0 THEN
  49.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  50.         GOTO QUIT
  51.     END IF
  52. '$ENDIF ''DEBUG
  53.  
  54.  
  55. WELCOME:
  56.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  57.     IF sz$ = "CONTINUE" THEN
  58.         UIPop 1
  59.     ELSE
  60.         GOSUB ASKQUIT
  61.         GOTO WELCOME
  62.     END IF
  63.  
  64. AUTFILE:
  65.     sz$ = UIStartDlg(CUIDLL$, AUTFILE, "FInfoDlgProc", APPHELP, HELPPROC$)
  66.     IF sz$ = "CONTINUE" THEN
  67.         UIPop 1
  68.     ELSE
  69.         GOSUB ASKQUIT
  70.         GOTO AUTFILE
  71.     END IF
  72.  
  73.  
  74. GETPATH:
  75.     SetSymbolValue "EditTextIn", DEST$
  76.     SetSymbolValue "EditFocus", "END"
  77. GETPATHL1:
  78.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  79.     DEST$ = GetSymbolValue("EditTextOut")
  80.  
  81.     IF sz$ = "CONTINUE" THEN
  82.         IF IsDirWritable(DEST$) = 0 THEN
  83.             GOSUB BADPATH
  84.             GOTO GETPATHL1
  85.         END IF
  86.         UIPop 1
  87.     ELSEIF sz$ = "REACTIVATE" THEN
  88.         GOTO GETPATHL1
  89.     ELSEIF sz$ = "BACK" THEN
  90.         UIPop 1
  91.         GOTO WELCOME
  92.     ELSE
  93.         GOSUB ASKQUIT
  94.         GOTO GETPATH
  95.     END IF
  96.  
  97.  
  98.     Install
  99.  
  100.  
  101. QUIT:
  102.     ON ERROR GOTO ERRQUIT
  103.  
  104.     IF ERR = 0 THEN
  105.         dlg% = EXITSUCCESS
  106.     ELSEIF ERR = STFQUIT THEN
  107.         dlg% = EXITQUIT
  108.     ELSE
  109.         dlg% = EXITFAILURE
  110.     END IF
  111. QUITL1:
  112.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  113.     IF sz$ = "REACTIVATE" THEN
  114.         GOTO QUITL1
  115.     END IF
  116.     UIPop 1
  117.  
  118.     END
  119.  
  120. ERRQUIT:
  121.     i% = DoMsgBox("Setup sources were corrupted !", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  122.     END
  123.  
  124.  
  125.  
  126. BADPATH:
  127.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  128.     IF sz$ = "REACTIVATE" THEN
  129.         GOTO BADPATH
  130.     END IF
  131.     UIPop 1
  132.     RETURN
  133.  
  134.  
  135.  
  136. ASKQUIT:
  137.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  138.  
  139.     IF sz$ = "EXIT" THEN
  140.         UIPopAll
  141.         ERROR STFQUIT
  142.     ELSEIF sz$ = "REACTIVATE" THEN
  143.         GOTO ASKQUIT
  144.     ELSE
  145.         UIPop 1
  146.     END IF
  147.     RETURN
  148.  
  149.  
  150.  
  151. '**
  152. '** Purpose:
  153. '**     Builds the copy list and performs all installation operations.
  154. '** Arguments:
  155. '**     none.
  156. '** Returns:
  157. '**     none.
  158. '*************************************************************************
  159. SUB Install STATIC
  160.  
  161.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  162.     
  163.     OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
  164.     WriteToLogFile ""
  165.     WriteToLogFile "  Windows directory: '" + DEST$ + "'"
  166.     WriteToLogFile ""
  167.  
  168.     AddSectionFilesToCopyList "Files", SrcDir$, DEST$
  169.     CopyFilesInCopyList
  170.  
  171.     ini$ = MakePath(DEST$, "DPW.INI")
  172.     CreateIniKeyValue ini$, "Director Player for Windows", "MovieExtension", ".mmm" , cmoOverwrite
  173.     CreateIniKeyValue ini$, "Director Player for Windows", "ProjectorExtension", ".exe" , cmoOverwrite
  174.     CreateIniKeyValue ini$, "Director Player for Windows", "ControlPanel", "1" , cmoOverwrite
  175.     CreateIniKeyValue ini$, "Director Player for Windows", "ViewScreen", "1" , cmoOverwrite
  176.     CreateIniKeyValue ini$, "Director Player for Windows", "ShowLingoAlerts", "1" , cmoOverwrite
  177.     CreateIniKeyValue ini$, "Director Player for Windows", "MessageWindow", "0" , cmoOverwrite
  178.     CreateIniKeyValue ini$, "Director Player for Windows", "RepeatSetting", "0" , cmoOverwrite
  179.     CreateIniKeyValue ini$, "Director Player for Windows", "PlayOnStage", "1" , cmoOverwrite
  180.  
  181.  
  182.     CreateIniKeyValue ini$, "fonts", "FontMapping1", """Chicago""->""Arial""" , cmoOverwrite
  183.     CreateIniKeyValue ini$, "fonts", "FontMapping2", """Geneva""->""Arial""" , cmoOverwrite
  184.     CreateIniKeyValue ini$, "fonts", "FontMapping3", """Monaco""->""Terminal""" , cmoOverwrite
  185.     CreateIniKeyValue ini$, "fonts", "FontMapping4", """New York""->""Times New Roman""" , cmoOverwrite
  186.     CreateIniKeyValue ini$, "fonts", "FontMapping5", """Times""->""Times New Roman""" , cmoOverwrite
  187.     CreateIniKeyValue ini$, "fonts", "FontMapping6", """Helvetica""->""Arial""" , cmoOverwrite
  188.     CreateIniKeyValue ini$, "fonts", "FontMapping7", """Courier""->""Courier New""" , cmoOverwrite
  189.     CreateIniKeyValue ini$, "fonts", "FontMapping8", """Palatino""->""Times New Roman""" , cmoOverwrite
  190.     CreateIniKeyValue ini$, "fonts", "FontMapping9", """Avant Garde""->""Futura""" , cmoOverwrite
  191.     CreateIniKeyValue ini$, "fonts", "FontMapping10", """Bodoni""->""Bodoni""" , cmoOverwrite
  192.  
  193.     i% = AutoRedactor(SrcDir$)
  194.  
  195.     CreateProgmanGroup "SUPERSONIC", "", cmoNone
  196.     ShowProgmanGroup  "SUPERSONIC", 1, cmoNone
  197.     CreateProgmanItem "SUPERSONIC", "Supersonic", MakePath(SrcDir$,"supers.exe"), "", cmoOverwrite
  198.  
  199.     CloseLogFile
  200.  
  201. END SUB
  202.  
  203.  
  204.  
  205. '**
  206. '** Purpose:
  207. '**     Appends a file name to the end of a directory path,
  208. '**     inserting a backslash character as needed.
  209. '** Arguments:
  210. '**     szDir$  - full directory path (with optional ending "\")
  211. '**     szFile$ - filename to append to directory
  212. '** Returns:
  213. '**     Resulting fully qualified path name.
  214. '************************************************************************
  215. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  216.     IF szDir$ = "" THEN
  217.         MakePath = szFile$
  218.     ELSEIF szFile$ = "" THEN
  219.         MakePath = szDir$
  220.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  221.         MakePath = szDir$ + szFile$
  222.     ELSE
  223.         MakePath = szDir$ + "\" + szFile$
  224.     END IF
  225. END FUNCTION
  226.